# build-web.ps1 [version]
# version 镜像版本，默认latest,指定版本号最后的tag名称为`v版本号`

# 构建ui,更改npm源为本地源
docker build ./web/SourceCode/VUE -t crm_ui:latest --build-arg NPM_REGISTRY=http://mirrors.local.com/npm

$tags='-t swr.cn-east-3.myhuaweicloud.com/erp4/crm:latest'
if ( $1 ) {
    tags+=" -t swr.cn-east-3.myhuaweicloud.com/erp4/crm:v$1"
}
$command="docker build $tags web"
echo $command
Invoke-Expression $command 